package com.cloud.phone.constants

import android.Manifest
import com.cloud.phone.BuildConfig

/**
 * @auth: njb
 * @date: 2024/4/4 16:49
 * @desc: 常量工具类
 */
object Constants {

    //    const val HOST_IP = "124.243.132.199"//云手机和后台连接websocket地址
    //const val BASE_URL = "https://www.wanandroid.com"
    @JvmField
    var BASE_URL = BuildConfig.HOST_IP
    //const val BASE_URL = "https://api.ipidea.net"
    @JvmField
     var userName: String = BuildConfig.USER_NAME
    @JvmField
     var password = BuildConfig.PASS_WORD

    //是否为系统应用-----镜像打包时改为true
    const val isServiceApplication: Boolean = true

    //修改ip端口直接将下面的5个全部注释并解开云端ip的注释即可

    //本地的ip端口配置
/*    @JvmField
    var HTTP_FRONT = "http://"
    @JvmField
    var HOST_IP = "172.16.33.35:8088"//云手机和后台连接获取token时的地址
    @JvmField
    var HOST_PORT_HTTP = ""//获取token的端口号
    @JvmField
    var HOST_WEBSOCKET_IP = "172.16.33.35"//云手机和后台连接websocket地址
    @JvmField
    var HOST_WEBSOCKET_PORT = "8087"//云手机和后台连接websocket地址*/


    //测试环境ip端口配置
//    @JvmField
//    var HTTP_FRONT = "https://"
//    @JvmField
//    var HOST_IP = "test-api.yunleduo.com"//云手机和后台连接获取token时的地址
//    @JvmField
//    var HOST_PORT_HTTP = ""//获取token的端口号-8088-华为云
//    @JvmField
//    var HOST_WEBSOCKET_IP = "124.243.132.199"//云手机和后台连接websocket地址
//    @JvmField
//    var HOST_WEBSOCKET_PORT = "8087"//云手机和后台连接websocket地址--8086-华为云


    //正式环境ip端口配置
    @JvmField
    var HTTP_FRONT = "https://"
    @JvmField
    var HOST_IP = BuildConfig.HOST_IP
    @JvmField
    var HOST_PORT_HTTP = ""//获取token的端口号-8088-华为云
    @JvmField
    var HOST_WEBSOCKET_IP = BuildConfig.HOST_WEBSOCKET_IP
    @JvmField
    var HOST_WEBSOCKET_PORT = "8087"//云手机和后台连接websocket地址--8086-华为云


    @JvmField
    var BASE_WEB_SOCKET_URL_FRONT = "ws://" + HOST_WEBSOCKET_IP + ":" + HOST_WEBSOCKET_PORT

    //云手机和后台连接websocket地址
//    const val BASE_WEB_SOCKET_URL = "ws://"+ this.HOST_IP +":"+ HOST_PORT+"/1/24f7044f-0d00-43cc-82c0-1fc8deef25f9/2b8b58063f744c84a8986759d830dd16/2222"//云手机和后台连接websocket地址
//    const val BASE_WEB_SOCKET_URL = "ws://172.16.33.10:8086/1/eac6f7f8-d65a-4e8e-b27e-589c1ed5861e/2b8b58063f744c84a8986759d830dd16/1"//云手机和后台连接websocket地址
    const val IP_WHITE_ADD = "api/open/white_add"

    const val GET_TOKEN_REQUEST_URL = "im/token/"
    const val GET_SYNC_FIRST_DATA_URL = "im/init/info"
    const val RESULT_TRUE = "true"
    const val RESULT_FALSE = "false"

    const val TYPE_CONNECT = "connect" // 与服务端建立连接

    const val TYPE_PING = "ping" // 与服务端心跳检测

    const val TYPE_PONG = "pong" // 与服务端心跳检测
    const val PHONE_ID = "phoneId"
    const val PRODUCT_ID = "96c362ec1f694a3dac667d6b8d7972ce"//项目id

    const val UPDATE_APK = "/api/admin/phone/update/apk"

    const val CLOUD_APP_RUN_ACTION = "com.cloud.running"
    const val DY_SPLASH_ACTIVITY = "om.ss.android.ugc.aweme.splash.SplashActivity"
    const val CLOUD_PACKAGE_NAME = "com.ss.android.ugc.aweme"

    const val tiktokPackageName = "com.zhiliaoapp.musically"//tiktok的包名
    const val faceBookPackageName = "com.facebook.katana"//faceBook的包名
    const val whatsAppPackageName = "com.whatsapp"//whatsapp的包名
    const val twitterPackageName = "com.twitter.android"//twitter的包名
    const val instagramPackageName = "com.instagram.andorid"//instagram的包名

    const val iflytekPackageName = "com.iflytek.inputmethod"//instagram的包名

    /**
     * app被杀死广播
     */
    @JvmStatic
    var ACTION_APP_KILLED: String = "android.intent.action.APP_KILLED"

    /**
     * App添加后台进程清理白名单
     */
    const val ADD_BG_KILLER_WHITE_APP = "dumpsys cph_performance addBgKillerWhiteApp "

    /**
     * 添加后台自启动管理白名单
     */
    const val ADD_AUTO_RUN_WHITE_APP = "dumpsys cph_performance addAutoRunWhiteApp "

    const val QUERY_APP_LIST_TIME = 1000L * 60

    /**
     * websocket地址
     */
    const val BASE_REMOTE_WS_PREFIX = ""

    const val WHAT_HANDLE_RECEIVED_MSG = 1 //收到了远端发来的消息

    const val WHAT_REMOTE_INTERRUPT = 2 //远端主动终端了连接

    const val WHAT_LOCAL_INTERRUPT = 5 //本地终端断开了连接

    const val WHAT_CONNECT_OPEN = 3 //连接建立成功并准备就绪

    const val WHAT_FETCHING_LOG_ID = 4 //获取日志ID

    const val WHAT_LIVE = 6 //发送心跳包;

    const val WHAT_LIVE_TIME = 30 * 1000 //心跳包时间

    const val DEVICE_MAC_ADDRESS = "device_mac_address" //设备的mac地址

    /**
     * 开启vpn服务action
     */
    const val ACTION_CONNECT = "com.cloud.phone.android.cloud_vpn.START"

    /**
     * 停止vpn服务action
     */
    const val ACTION_DISCONNECT = "com.cloud.phone.android.cloud_vpn.STOP"

    /**
     * vpn代理DNS
     */
    //const val DNS = "162.158.188.43"
    const val DNS = "8.8.8.8"

    /**
     * vpm代理路由
     */
    const val ROUTE = "0.0.0.0"

    /**
     * vpn代理地址
     */
    const val ADDRESS = "10.0.0.2"

    /**
     * http代理地址
     */
    // const val HTTP = "customer-d12980:1613e097@proxy.ipipgo.com:31212"
    //const val HTTP = "terencejumping:QVWz8zwtxc@161.77.55.101:50101"
    //const val HTTP = "172.16.33.19:53476"
    //const val HTTP = "192.168.0.106:55581"

    /**
     * SOCKS5代理地址
     */
    const val SOCKS5 = "socks5://l6W1sjwclS:80766829@154.200.18.18:6001"

    /**
     * 请求最近使用应用权限code
     */
    const val REQUEST_PACKAGE_USAGE_STATS = 1001

    /**
     * 请求文件权限code
     */
    const val REQUEST_READ_WRITE_FILE_PERMISSION = 1253

    /**
     * 截图权限
     */
    const val MY_PERMISSIONS_REQUEST_FOREGROUND_SERVICE = 1254

    /**
     * vpn服务是否运行
     */
    @JvmField
    var IS_MY_VPN_SERVICE_RUNNING: Boolean = false

    /**
     * 默认的代理地址
     */
    @JvmField
    var PROXY_SOCKS_URL = "terencejumping:QVWz8zwtxc@161.77.55.101:50101"

    /**
     * app是否打开
     */
    @JvmField
    var IS_APP_START = false

    /**
     * 代理任务类型
     */
    @JvmField
    var VPN_TASK_TYPE = 0

    /**
     * 任务状态
     */
    @JvmField
    var TASK_STATUS = false

    /**
     * 正在执行的任务类型
     */
    @JvmField
    var TASK_TYPE = 0

    /**
     * 任务是否运行
     */
    @JvmField
    var TASK_IS_RUNNING = false

    /**
     * ip代理地址
     */
    @JvmField
    var SOCKS5_RUL = "socks_url"

    /**
     * 任务id
     */
    @JvmField
    var TASK_ID = "task_id"

    @JvmField
    var IS_VPN_PERMISSION_OPEN = "vpn_permission_open"

    /**
     * 代理IP
     */
    @JvmField
    var PROXY_IP = "proxy_ip"

    @JvmField
    var REQUEST_OVERLAY: Int = 1002

    @JvmField
    var TOKEN:String = ""

    @JvmField
    var APP_IS_UPDATE = "app_update"

    const val REQUEST_CODE_PERMISSIONS = 101

    val REQUIRED_PERMISSIONS = arrayOf(
        Manifest.permission.WRITE_EXTERNAL_STORAGE,
        Manifest.permission.READ_EXTERNAL_STORAGE,
    )

    /**
     * 讯飞输入法隐私协议是否同意
     */
    @JvmField
    var FLY_INPUT_IS_AGREE = "is_agree"

   val UM_APP_KEY by lazy { "666c978ecac2a664de4b263a" }

   val UM_APP_CHANNEL by lazy { "android" }
}